<template>
	<view class="contact">
		<image class="img" src="http://img95.699pic.com/photo/50058/8421.jpg_wh860.jpg"></image>
		<view class="info">
			<view @click="handelMakeCall">联系电话: 13680638720 (点击拨打)</view>
			<view>地址:广州市天河区天河北路88-99号</view>
		</view>
		<map :latitude="latitude" :scale="scale" :longitude="longitude" :markers="markers"></map>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				latitude:23.176465,
				longitude:113.35038,
				scale:14,
				markers:[
					{
						latitude:23.176465,
						longitude:113.35038,
						iconPath:'../../static/icon/hmlogo.png',
						width:30,
						height:30
					}
				]
			}
		},
		onLoad() {
			this.getLocation();
		},
		methods:{
			getLocation(){
				uni.getLocation({
				    type: 'gcj02', //返回可以用于uni.openLocation的经纬度
				    success: function (res) {
				       this.latitude = res.latitude;
				       this.longitude = res.longitude;
				    }
				});
			},
			handelMakeCall(){
				uni.makePhoneCall({
					phoneNumber:'13680638720',
					success(res){
						console.log(res)
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.contact{
		.img{
			width: 750rpx;
			height: 320rpx;
		}
		.info{
			padding: 10rpx 20rpx;
			font-size: 30rpx;
			view{
				line-height: 80rpx;
				text-indent: 20rpx;
				border-bottom: 1rpx dashed #ccc;
			}
		}
		map{
			width: 100%;
			height: calc(100vh - 592rpx);
		}
	}
</style>
